<template>
	<view>
		<!--基础信息-->
		<view class="btName">基础信息</view>
		<view class="flex-white-plr26 ptb20 bdb_f5">
			<text class="mr26">票面金额</text>
			<view class="width276 color333 flexC" v-if="infoObj.money">
				<text>¥{{infoObj.money}}</text>
			</view>
			<view v-else class="width276">暂无</view>
		</view>
		<view class="flex-white-plr26 ptb20 bdb_f5">
			<text class="mr26">经手人员</text>
			<view v-if="infoObj.handle_user_name" class="width276 color333">{{infoObj.handle_user_name}}</view>
			<view v-else class="width276">暂无</view>
		</view>
		<view class="flex-white-plr26 ptb20 bdb_f5">
			<text class="mr26">收票日期</text>
			<view v-if="infoObj.handle_date" class="width276 color333">{{infoObj.handle_date}}</view>
			<view v-else class="width276">暂无</view>
		</view>
		<view class="flex-white-plr26 ptb20 bdb_f5">
			<text class="mr26">相关供应商</text>
			<view v-if="infoObj.supplier_name" class="width276 blueColor" @click="navigateToFun('supplier')">
				<text>{{infoObj.supplier_name}}</text>
			</view>
			<view v-else-if="infoObj.customer_name" class="width276 blueColor" @click="navigateToFun('client')">
				<text>{{infoObj.customer_name}}</text>
			</view>
			<view v-else class="width276">暂无</view>
		</view>
		<view class="flex-white-plr26 ptb20 bdb_f5">
			<text class="mr26">单据类型</text>
			<view class="width276 color333 flexC" v-if="infoObj.bus_info && infoObj.bus_info.type">
				<text>{{infoObj.bus_info.type}}</text>
			</view>
			<view v-else class="width276">暂无</view>
		</view>
		<view class="flex-white-plr26 ptb20 bdb_f5">
			<text class="mr26">关联单据</text>
			<view v-if="infoObj.bus_info && infoObj.bus_info.name" class="width276 blueColor" @click="navigateToFun('ordertype')">
				<text>{{infoObj.bus_info.name}}</text>
			</view>
			<view v-else class="width276">暂无</view>
		</view>
		<view class="flex-white-plr26 ptb20 bdb_f5">
			<text class="mr26">收票期次</text>
			<view class="width276 color333 flexC" v-if="infoObj.stages">
				<text>{{infoObj.stages}}</text>
			</view>
			<view v-else class="width276">暂无</view>
		</view>
		<view class="flex-white-plr26 ptb20 bdb_f5">
			<text class="mr26">备注</text>
			<view v-if="infoObj.remark" class="width276 color333">{{infoObj.remark}}</view>
			<view v-else class="width276">暂无</view>
		</view>
		
		<!--发票信息-->
		<view class="btName">发票信息</view>
		<view class="flex-white-plr26 ptb20 bdb_f5">
			<text class="mr26">发票类型</text>
			<view class="width276 color333 flexC" v-if="infoObj.invoice_type">
				<text>{{infoObj.invoice_type}}</text>
			</view>
			<view v-else class="width276">暂无</view>
		</view>
		<view class="flex-white-plr26 ptb20 bdb_f5">
			<text class="mr26">发票编号</text>
			<view class="width276 color333 flexC" v-if="infoObj.invoice_no">
				<text>{{infoObj.invoice_no}}</text>
			</view>
			<view v-else class="width276">暂无</view>
		</view>
		<view class="flex-white-plr26 ptb20 bdb_f5">
			<text class="mr26">抬头类型</text>
			<view class="width276 color333 flexC" v-if="infoObj.name_type">
				<text>{{infoObj.name_type}}</text>
			</view>
			<view v-else class="width276">暂无</view>
		</view>
		<view class="flex-white-plr26 ptb20 bdb_f5">
			<text class="mr26">开票方名称</text>
			<view class="width276 color333 flexC" v-if="infoObj.name">
				<text>{{infoObj.name}}</text>
			</view>
			<view v-else class="width276">暂无</view>
		</view>
		<view class="flex-white-plr26 ptb20 bdb_f5">
			<text class="mr26">识别号</text>
			<view class="width276 color333 flexC" v-if="infoObj.credit_code">
				<text>{{infoObj.credit_code}}</text>
			</view>
			<view v-else class="width276">暂无</view>
		</view>
		<view class="flex-white-plr26 ptb20 bdb_f5">
			<text class="mr26">开票方开户行</text>
			<view class="width276 color333 flexC" v-if="infoObj.bank_name">
				<text>{{infoObj.bank_name}}</text>
			</view>
			<view v-else class="width276">暂无</view>
		</view>
		<view class="flex-white-plr26 ptb20 bdb_f5">
			<text class="mr26">开票方账号</text>
			<view class="width276 color333 flexC" v-if="infoObj.bank_account">
				<text>{{infoObj.bank_account}}</text>
			</view>
			<view v-else class="width276">暂无</view>
		</view>
		<view class="flex-white-plr26 ptb20 bdb_f5">
			<text class="mr26">开票方地址</text>
			<view class="width276 color333 flexC" v-if="infoObj.invoice_address">
				<text>{{infoObj.invoice_address}}</text>
			</view>
			<view v-else class="width276">暂无</view>
		</view>
		<view class="flex-white-plr26 ptb20 bdb_f5">
			<text class="mr26">开票方电话</text>
			<view class="width276 color333 flexC" v-if="infoObj.mobile">
				<text>{{infoObj.mobile}}</text>
			</view>
			<view v-else class="width276">暂无</view>
		</view>
		
		<!--系统信息-->
		<view class="btName">系统信息</view>
		<view class="flex-white-plr26 ptb20 bdb_f5">
			<text class="mr26">创建人</text>
			<view v-if="infoObj.create_user_name" class="width276 color333">{{infoObj.create_user_name}}</view>
			<view v-else class="width276">暂无</view>
		</view>
		<view class="flex-white-plr26 ptb20 bdb_f5">
			<text class="mr26">创建时间</text>
			<view v-if="infoObj.create_time" class="width276 color333">{{infoObj.create_time}}
			</view>
			<view v-else class="width276">暂无</view>
		</view>
		<view class="flex-white-plr26 ptb20 bdb_f5">
			<text class="mr26">更新时间</text>
			<view v-if="infoObj.update_time" class="width276 color333">{{infoObj.update_time}}
			</view>
			<view v-else class="width276">暂无</view>
		</view>
	</view>
</template>

<script>
	let that = ''
export default {
	props: {
		infoObj: {
			type: Object,
			default: () => {}
		}
	},
	data() {
		return {

		};
	},
	created() {
		that = this;
	},
	methods: {
		navigateToFun: function(type) {
			if(type == 'supplier') {
				uni.navigateTo({
					url: '/pages/crm/sup_supplier/detail?fromDetail=1&id=' + (that.infoObj.supplier_id || that.infoObj.id)
				})
			} else if(type == 'client') {
				uni.navigateTo({
					url: '/pages/crm/cst_customer/detail?id=' + that.infoObj.customer_id
				})
			} else if (type == 'ordertype') {
				let orderType = that.infoObj.bus_type;
				let gotoUrl = '/pages/crm/';
				if (orderType == 'pos_contract') {
					gotoUrl += 'pos_contract/detail'
				} else if (orderType == 'purchase_order') {
					gotoUrl += 'purchase_order/detail'
				}else{
					gotoUrl += 'purchase_contract/detail'
				}
				gotoUrl += '?fromDetail=1&id=' + that.infoObj.bus_id
				uni.navigateTo({
					url:gotoUrl
				})
			}
		}
	}
}
</script>